package com.leoman.dao;

import com.leoman.entity.Banner;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

/**
 * 广告
 * Created by 涂奕恒 on 2016/10/18.
 */
public interface BannerDao extends JpaRepository<Banner, Integer>, JpaSpecificationExecutor<Banner> {

    @Query("select a from Banner a where a.type = ?1 and a.position = ?2")
    Banner findOneByTypeAndPosition(Integer type, Integer position);
}